package com.yx.yinshanjinniu.adapters;

import android.content.Context;
import android.view.View;
import android.widget.TextView;


import com.yx.yinshanjinniu.R;
import com.yx.yinshanjinniu.base.MyBaseAdapter;
import com.yx.yinshanjinniu.bean.BankListBean;

import java.util.List;

public class BankListAdapter extends MyBaseAdapter<BankListBean> {

    public BankListAdapter(Context mContext, List<BankListBean> mList) {
        super(mContext, mList);
    }

    /**
     * 需要子类实现，需要返回item布局的resource id
     */
    @Override
    public int getItemResource() {
        return R.layout.item_info_layout;
    }

    /**
     * 需要子类实现, 使用该getItemView方法替换原来的getView方法
     * 绘制试图View
     *
     * @param position
     * @param convertView
     * @param holder
     */
    @Override
    public View getItemView(int position, View convertView, ViewHolder holder) {
        TextView name = holder.getView(R.id.tv_name);
        BankListBean bankListBean = mList.get(position);
        name.setText(bankListBean.name);
        return convertView;
    }
}
